﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PBDesk.Business.Gigya;
using PBDesk.Business.AutoEnums;
using PBDesk.Utilities;

namespace PBDesk.Business.UserManager
{
    public class CommonHelper
    {
        public static LeisureUserAuthInfo GetLeisureUserAuthInfo(GigyaUser guser)
        {
            LeisureUserAuthInfo o = null;
            if (guser != null)
            {
                o = new LeisureUserAuthInfo();
                o.AuthServiceProviderId = AuthenticationServiceProvider.Gigya;
                o.AuthServiceProviderUId = guser.UID;
                if (guser.loginProvider.IsNotNullAndNotEmpty())
                {
                    o.LoginProviderId = guser.loginProvider.ToEnum<LoginProvider>();
                }
                o.LoginProviderUId = guser.loginProviderUID;                
            }
            return o;
        }
    }
}
